﻿using System.Data.Common;
using System.Data.Entity;
using Abp.Zero.EntityFramework;
using XHD.WXZJ.Authorization.Roles;
using XHD.WXZJ.Departments;
using XHD.WXZJ.Menus;
using XHD.WXZJ.MultiTenancy;
using XHD.WXZJ.Posts;
using XHD.WXZJ.Users;

namespace XHD.WXZJ.EntityFramework
{
    public class WXZJDbContext :AbpZeroDbContext<Tenant, Role, User>
    {
        //TODO: Define an IDbSet for your Entities...
        //添加完数据实体后一定要在这里添加实体集合，实体才会初始化
         public virtual IDbSet<Menu> Menus { get; set; }

          //public virtual IDbSet<PostUser> PostUsers { get; set; }

        // public virtual IDbSet<Post> Posts { get; set; }

        // public virtual IDbSet<Department> Departments { get; set; }
        /* NOTE: 
         *   Setting "Default" to base class helps us when working migration commands on Package Manager Console.
         *   But it may cause problems when working Migrate.exe of EF. If you will apply migrations on command line, do not
         *   pass connection string name to base classes. ABP works either way.
         */
        public WXZJDbContext()
            : base("Default")
        {

        }

        /* NOTE:
         *   This constructor is used by ABP to pass connection string defined in WXZJDataModule.PreInitialize.
         *   Notice that, actually you will not directly create an instance of WXZJDbContext since ABP automatically handles it.
         */
        public WXZJDbContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {

        }

        //This constructor is used in tests
        public WXZJDbContext(DbConnection connection)
            : base(connection, true)
        {

        }
    }
}
